home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7892 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  619 b 

  1. Path: kuhub.cc.ukans.edu!anh
  2. From: anh@kuhub.cc.ukans.edu
  3. Newsgroups: comp.lang.c++
  4. Subject: How big is the 0
  5. Message-ID: <1996Feb17.132420.114207@kuhub.cc.ukans.edu>
  6. Date: 17 Feb 96 13:24:20 CST
  7. Organization: University of Kansas Academic Computing Services
  8.  
  9.  
  10. Hello,
  11.  
  12. In C, anytime I need to do a null pointer check I would do this:
  13.  
  14.     MyType *p;
  15.  
  16.     if(p==(MyType*)0)
  17.         bla;
  18.  
  19. The new operator supposedly return a 0 upon failure. Can I rely on the 
  20. compiler to make sure the 0 is as big as the size of the pointer? For 
  21. example, ALPHA's pointers are 64 bits long which is different from the 32 bits
  22. int.
  23.  
  24. Thank-you.
  25.  
  26. Anh
  27.